<?php
namespace app\index\controller;
use think\Controller;

class Index extends Controller
{
    public function index()
    {
        return view();
    }


//gggyvbjhbjbjjghvhhuhujh
    public function login(){
    	$name = input('param.name');
    	$password = input('param.password');
    	if(request()->isPost()){
    		$data = db('user')->where(['name'=>$name,'password'=>$password])->find();
    		if($data){
    			session('user_info',$data);
    			return $this->redirect('index');
    		}else{
    			return $this->redirect('login');
    		}
    		//dump($data);exit;
    	}else{
    		//dump(242314);exit;
    		return view();
    	}
    }
}
